﻿using Autofac;
using Autofac.Integration.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using ZCSBZPJ.App_Start;
using ZP.BLL;
using ZP.IBLL;

namespace ZCSBZPJ
{
    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            //BundleTable.EnableOptimizations = true;//js、css压缩
            //MiniProfilerEF6.Initialize();//MiniProfiler监控ef
            //GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear();//webapi默认JSON
            AutoFacConfig.Register();//autofac:控制反转，依赖注入配置

            #region 方法
            /*try
            {
                //初始化容器，并返回适用于MVC的Autofac解析器
                IDependencyResolver autoFacResolver = AutoFacConfig.Init();
                //将autoFac解析器设置为系统DI解析器
                DependencyResolver.SetResolver(autoFacResolver);

            }
            catch (Exception ee)
            {
                throw new Exception(ee.ToString());
            }*/
            #endregion
        }

    }
}
